package gov.police.diary.model;
// Generated 00:36:25 27-04-2011 by Hibernate Tools 3.2.1.GA


import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * PolDepartment generated by hbm2java
 */
@Entity
@Table(name="pol_department"
    ,catalog="lportal"
)
public class PolDepartment  implements java.io.Serializable {


     private long idDepartment;
     private PolHeadquater polHeadquater;
     private String name;
     private Set<PolUnit> polUnits = new HashSet<PolUnit>(0);
     private Set<PolPoliceman> polPolicemans = new HashSet<PolPoliceman>(0);

    public PolDepartment() {
    }

	
    public PolDepartment(long idDepartment, PolHeadquater polHeadquater) {
        this.idDepartment = idDepartment;
        this.polHeadquater = polHeadquater;
    }
    public PolDepartment(long idDepartment, PolHeadquater polHeadquater, String name, Set<PolUnit> polUnits, Set<PolPoliceman> polPolicemans) {
       this.idDepartment = idDepartment;
       this.polHeadquater = polHeadquater;
       this.name = name;
       this.polUnits = polUnits;
       this.polPolicemans = polPolicemans;
    }
   
     @Id 
    
    @Column(name="idDepartment", unique=true, nullable=false)
    public long getIdDepartment() {
        return this.idDepartment;
    }
    
    public void setIdDepartment(long idDepartment) {
        this.idDepartment = idDepartment;
    }
@ManyToOne(fetch=FetchType.LAZY)
    @JoinColumn(name="idheadquater", nullable=false)
    public PolHeadquater getPolHeadquater() {
        return this.polHeadquater;
    }
    
    public void setPolHeadquater(PolHeadquater polHeadquater) {
        this.polHeadquater = polHeadquater;
    }
    
    @Column(name="name", length=75)
    public String getName() {
        return this.name;
    }
    
    public void setName(String name) {
        this.name = name;
    }
@OneToMany(cascade=CascadeType.ALL, fetch=FetchType.LAZY, mappedBy="polDepartment")
    public Set<PolUnit> getPolUnits() {
        return this.polUnits;
    }
    
    public void setPolUnits(Set<PolUnit> polUnits) {
        this.polUnits = polUnits;
    }
@OneToMany(cascade=CascadeType.ALL, fetch=FetchType.LAZY, mappedBy="polDepartment")
    public Set<PolPoliceman> getPolPolicemans() {
        return this.polPolicemans;
    }
    
    public void setPolPolicemans(Set<PolPoliceman> polPolicemans) {
        this.polPolicemans = polPolicemans;
    }




}


